output.metadata.push((k.clone(), val.to_string()));
}
}
+
+ // We randomized the data source with HashMaps, so we must sort the resulting vectors
+ // to produce a deterministic result
+ output.sort();
}
ret.overrides.insert(lib_name, output);
}
}
Ok((library_paths, library_links))
}
+
+ /// Sort the contents of the struct for consistent hashing.
+ /// Suggested if populated from a HashMap instead of a order-preserving data source
+ pub fn sort(&mut self){
+ self.library_paths.sort();
+ self.library_links.sort();
+ self.cfgs.sort();
+ self.metadata.sort();
+ self.rerun_if_changed.sort();
+ self.warnings.sort();
+ }
}
/// Compute the `build_scripts` map in the `Context` which tracks what build